FROM openjdk:8
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone
ENV TZ=GMT+08:00 \
  JVM_HEAP='-Xmx50m -Xms50m' \
  JVM_OPTS='' \
  ENDPOINT='tcp://106.75.50.110:1883' \
  PK='b6e2cc8aaf6c4255a15106d4806cd7ec' \
  DEV_ID='demo_gateway' \
  DEV_SECRET='ae0122eeb6cd48e4b10405d04987946f' \
  SERVER_PORT='8080'


WORKDIR /app
COPY target/*.jar server.jar
EXPOSE 8080
VOLUME /data
CMD  java $JVM_HEAP $JVM_OPTS -jar server.jar \
  --server.port=$SERVER_PORT \
  --connect.mqtt.endpoint=$ENDPOINT \
  --gateway.pk=$PK \
  --gateway.devId=$DEV_ID \
  --gateway.devSecret=$DEV_SECRET